<template>
  <div>
    <div class="record_box">
      <div class="title"><h2><slot></slot></h2></div>

      <div class="record_item" v-for="item in records">
        {{item.username}}于 {{item.create_date}}
          <span v-if="item.type == 1">出库</span>
        <span v-if="item.type == 2">入库</span>
        {{item.num}}件
      </div>

    </div>
  </div>
</template>

<script>
    export default {
        name: "recordView",
      props: {
        records: {
          type: Array,
          default() {
            return []
          }
        },
      },
    }
</script>

<style scoped>
  .record_box{
    margin: 10px;
    background: #ffffff;
    border-radius: 8px;
  }
  .record_box .title {
    padding: 10px;
  }
  .record_box .title h2{
    padding-left: 5px;
    font-size: .32rem;
    /*color: var(--color-tint);*/
    border-left: 3px solid var(--color-tint);
    font-weight: normal;
  }
  .record_item{
    padding: 10px;
    font-size: .28rem;
    border-top: 1px solid #eee;
  }
</style>
